<template>
  <div class="login">
    {{ msg }}
    <button @click="loginIn">登录</button>
    <button @click="loginOut">退出登录</button>
  </div>
</template>
<script setup>
import { ref, reactive } from "vue";
defineProps({
  msg: String,
});
let appuser = reactive({
  account: "973204217@qq.com",
  password: "13965873476"
});
const loginIn = () => {
  window.$api.user.login(appuser).then((res)=> {
    window.$utils.setStr("token", res.data);
  })
};
const loginOut = () => {
  window.$utils.del("token");
};
</script>